package com.zzyl.nursing.member.controller;

import com.zzyl.common.core.domain.R;
import com.zzyl.nursing.member.dto.MiniProgramLoginDto;
import com.zzyl.nursing.member.service.MiniProgramLoginService;
import com.zzyl.nursing.member.vo.MiniProgramLoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MiniProgramLoginController {
    @Autowired
    private MiniProgramLoginService miniProgramLoginService;

    /**
     * 小程序登录
     *
     * @param dto
     * @return
     */
    @PostMapping("/member/user/login")
    public R<MiniProgramLoginVo> login(@RequestBody MiniProgramLoginDto dto) {
        MiniProgramLoginVo miniProgramLoginVo = new MiniProgramLoginVo();
        miniProgramLoginVo = miniProgramLoginService.login(dto);
        return R.ok(miniProgramLoginVo);
    }

}
